package com.eugene.element;

import com.eugene.enums.EMathOperation;
import com.eugene.interfaces.Functionable;

public class BinaryOperation<T extends Functionable> {
	private String unaryId;
	private EMathOperation binaryOperation;
	private T reference;
	private T referencing;
	
	public <T extends Functionable> T getOperated(T rst){
		double temp=0.0;
		for(int i =0 ; i<reference.getOperands().size(); i++){
			temp = reference.getOperands().get(i).getValue() 
						+ referencing.getOperands().get(i).getValue();
			rst.getOperands().get(i).setValue(temp);
		}
		return rst;
	}
}
